﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<WRSManagementSystem.DomainModel.Entities.Task>" %>
<%
    using (Html.BeginForm())
    {%>
<fieldset>
    <legend></legend>
    
    <%=Html.HiddenFor(model => model.Id)%>
    <%
        Html.ValidationSummary();%>

    <div class="editor-label">
        <%=Html.Label("Nazwa")%>
    </div>
    <div class="editor-field">
        <%=Html.TextBoxFor(model => model.Name)%>
        <%=Html.ValidationMessageFor(model => model.Name)%>
    </div>
    
    <div class="editor-label">
        <%=Html.Label("Opis")%>
    </div>
    <div class="editor-field">
        <%=Html.TextBoxFor(model => model.Description)%>
        <%=Html.ValidationMessageFor(model => model.Description)%>
    </div>
    
    <div class="editor-label">
        <%=Html.Label("Początek")%>
    </div>
    <div class="editor-field">
               <%= Html.DatePicker( "StartDate", Html.Encode(String.Format("{0:00}/{1:00}/{2:0000}",Model.StartDate.Month,Model.StartDate.Day,Model.StartDate.Year)) ) %> 
    </div>
    <div class="editor-label">
        <%=Html.Label("Koniec")%>
    </div>
    <div class="editor-field">
               <%= Html.DatePicker( "EndDate", Html.Encode(String.Format("{0:00}/{1:00}/{2:0000}",Model.EndDate.Month,Model.EndDate.Day,Model.EndDate.Year)) ) %>
    </div>
    <div class="editor-label">
        <%=Html.Label("Aktywne")%>
    </div>
    <div class="editor-field">
        <%=Html.DropDownListFor(model => model.IsActive,
                                               new List<SelectListItem>
                                                   {
                                                       new SelectListItem {Text = "W trakcie", Value = "true"},
                                                       new SelectListItem {Text = "Ukończone", Value = "false"}
                                                   })%>
        <%=Html.ValidationMessageFor(model => model.IsActive)%>
    </div>
        <div class="editor-label">
        <%=Html.Label("Projekt")%>
    </div>
    <div class="editor-field">
        <%=Html.DropDownListFor(model => model.Project.Id, ViewData["Projects"] as SelectList)%>
        <%=Html.ValidationMessageFor(model => model.Project)%>
    </div>
    <p>
        <input type="submit" value="Zapisz" />
    </p>
</fieldset>
<%
    }%>